package com.brillilab.service.core.inventory.impl;

import com.brillilab.dao.mapper.inventory.InventoryShareMapper;
import com.brillilab.domain.enums.inventory.InventoryShareEnum;
import com.brillilab.domain.po.inventory.InventoryShare;
import com.brillilab.domain.po.inventory.ReagentInventory;
import com.brillilab.domain.vo.inventory.InventoryShareVo;
import com.brillilab.service.core.inventory.IInventoryShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wuzhiyu
 * @Title: InventoryShareServiceImpl
 * @ProjectName brill_lab
 * @Description: TODO
 * @date 2018/11/209:33
 */
@Service
@Transactional
public class InventoryShareServiceImpl implements IInventoryShareService {
    @Autowired
    private InventoryShareMapper inventoryShareMapper;
    @Override
    public List<ReagentInventory> getShareToMeInventoryList(Long labMemberId, InventoryShareEnum shareEnum,Integer inventoryIsDelete) {
        return inventoryShareMapper.getShareToMeInventoryList(labMemberId,shareEnum.getState(),inventoryIsDelete);
    }

    @Override
    public InventoryShare get(Long shareId) {
        return inventoryShareMapper.selectById(shareId);
    }

    @Override
    public Integer updateById(InventoryShare share) {
        return inventoryShareMapper.updateById(share);
    }

    @Override
    public Integer addList(List<InventoryShare> shareList) {
        return inventoryShareMapper.insertList(shareList);
    }

    @Override
    public List<InventoryShareVo> myShareList(Long labMemberId) {
        return inventoryShareMapper.getMyShareList(labMemberId);
    }
}
